package vn.raz.brainnydefense.object;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class PlantStage {
	public float x;
	public float y;
	public float aColor;
	public float time;
	public float basicTime;
	public TextureRegion image;
	
	public PlantStage(TextureRegion image, float x, float y) {
		this.image = image;
		this.x = x;
		this.y = y;
		this.aColor = 0;
		this.time = 0;
		this.basicTime = .4f;
	}
	
	public void update(float delta){
		time += delta;
		if(time<basicTime)	aColor += delta;
		if(time>basicTime)	aColor -= delta;
	}
	
	public float getColor(){
		if(aColor>1)	return 1;
		if(aColor<0)	return 0;
		return aColor;
	}
	
	public boolean isTimeUp(){
		return time>(basicTime*2);
	}
	
	public void reset(){
		time = 0;
	}
}
